﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Services;
using YaAppoint.Appointments.Pools;
using YaAppoint.Devices;
using YaAppoint.ExamAppies;

namespace YaAppoint.Rules
{
    /// <summary>
    /// 规则结构工厂
    /// </summary>
    [RemoteService(isEnabled: false)]
    public interface ISchemaFactory:IApplicationService
    {
        /// <summary>
        /// 获取设备规则结构
        /// </summary>
        Task<RuleSchema> GetDeviceRuleSchema(Guid deviceId);

        // 批量获取设备的RuleSchema
        Task<List<RuleSchema>> GetRuleSchemaList(List<DeviceDto> deviceList);

        /// <summary>
        /// 获取过滤器结构
        /// </summary>
        /// <param name="ruleSchema"></param>
        /// <returns></returns>
        FilterSchema GetDeviceFilerSchema(RuleSchema ruleSchema);

        /// <summary>
        /// 执行过滤结构，对号池做出判断
        /// </summary>
        /// <param name="pool">号池</param>
        /// <param name="applyItems">申请项目</param>
        /// <param name="filterSchema">过滤结构对象</param>
        /// <returns>针对号池进行规则运算的结果</returns>
        ResultDto ExecuteFilterSchema(PoolDto pool, List<ExamApplicationDto> applyItems, FilterSchema filterSchema);
    }

}
